/*******************************************************************************
 * Copyright (c) 2018, 2018 GuoGuang Corporation and others.
 * All rights reserved. 
 *  
 * Create By Time 2018-2018年3月21日-上午9:19:24
 * Contributors:
 *     longshiyu
 * @longsy316@163.com
 *******************************************************************************/

package com.lsy.onehot.rnn.qa.data;

import java.io.BufferedReader;
import java.io.IOException;

import com.lsy.lstm.ai.rnn.qa.dataset.io.CorpusHandle;
import com.lsy.onehot.rnn.qa.data.extend.AbstractCurpusIDictProcess;
import com.lsy.onehot.rnn.qa.inner.IOnehot;

/**
 * @author Administrator
 * @time 2018 - 2018年3月21日 - 上午9:19:24
 * @desc Read_50w_CurpusDictProcess.java
 */
public class Read_gossip_CurpusDictProcess extends  AbstractCurpusIDictProcess{

	/**
	 * 
	 */
	public Read_gossip_CurpusDictProcess() {
		// TODO Auto-generated constructor stub
	}

	/** (non-Javadoc)
	 * @see com.lsy.onehot.rnn.qa.data.extend.AbstractCurpusIDictProcess#handleDict()
	 * @author longsy
	 * @time : 2018 2018年3月21日 上午9:19:51
	 * @desc Read_50w_CurpusDictProcess.java
	 * @throws IOException
	 * handleDict $
	 * (功能描述)
	 */
	@Override
	public void handleDict() throws IOException {
		// TODO Auto-generated method stub
		try (BufferedReader br = CorpusHandle.readFile( IOnehot.DICT_SPELICAL_FILE_goossip )) {
        	String line;
        	long i = index ;
        	while( ( line = br.readLine() ) != null  ){
        		String[] _line  = line.split("\\#",-1) ;
        		process(_line[1] , dict_Q, i );
        		process(_line[2]  , dict_A, i );
        		i++;
        	}
        	index = i ;
    	}
		
	}

	/** (non-Javadoc)
	 * @see com.lsy.onehot.rnn.qa.data.extend.AbstractCurpusIDictProcess#handleSpecialDict()
	 * @author longsy
	 * @time : 2018 2018年3月21日 上午9:19:51
	 * @desc Read_50w_CurpusDictProcess.java
	 * @throws IOException
	 * handleSpecialDict $
	 * (功能描述)
	 */
	@Override
	public void handleSpecialDict() throws IOException {
		// TODO Auto-generated method stub
		
	}

}
